from flask import Flask, make_response, request

app = Flask(__name__)


@app.route('/')
def index():
    resp = make_response('set cookie')
    #设置cookie
    #resp.set_cookie('name', 'lisi')
    resp.set_cookie('name', 'lisi', max_age=3600)
    #获取cookie
    print(request.cookies.get('name'))
    #删除cookie
    resp.delete_cookie('name')
    return resp


if __name__ == '__main__':
    app.run()